@import '../theme/theme.scss';

//取出主题色
@function themed($key) {
  @return map-get($theme-map, $key);
}

//主题切换
@mixin themeify {
    @each $theme-name, $theme-map in $themes {
      $theme-map: $theme-map !global;
      [data-theme='#{$theme-name}'] & {
        @content;
      }
    }
}

//获取背景色
@mixin bg($key) {
  @include themeify {
    background-color: themed($key);
  }
}

//获取字体颜色
@mixin color($key) {
  @include themeify {
    color: themed($key);
  }
}

